Audioioctl (kdevt dev, unsigned int cmd, void*arg)

Some of the CDROM-ioctls defined in cdrom.h can be implemented by the routines described above, and hence the function cdromioctl will use those. However, most ioctls deal with audio-control. We have decided to leave these accessed through a single function, repeating the arguments cmd and arg. Note that the latter is of type void*, rather than unsigned longI>int. The routine cdromioctl () does do some useful things, though. It sanitizes the address format type to CDROMMSF (Minutes, Seconds, Frames) for all audio calls. It also verifies the memory location of arg, and reserves stack-memory for the argument. This makes implementation of the audioioctl () much simpler than in the old driver scheme. For an example you may look up the function cm206audioioctl () in cm206.c that should be updated with this documentation.

An unimplemented ioctl should return - EINVAL, but a harmless request (e.g., CDROMSTART) may be ignored by returning 0 (success). Other errors should be according to the standards, whatever they are. (We may decide to sanitize the return value in cdromioctl (), in order to guarantee a uniform interface to the audio-player software.)